﻿<controls:ChildWindow x:Class="LyncSilverlightApplication.addCustomGroup"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           xmlns:custom="clr-namespace:LyncSilverlightApplication"
           Width="400" Height="400" 
           Title="カスタムグループ追加/削除" Loaded="ChildWindow_Loaded_1">
    <controls:ChildWindow.Resources>
        <DataTemplate x:Key="GroupInfoTemplate">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" Text="{Binding GroupName}" Margin="3" Width="160"/>
                <TextBlock Grid.Column="1" Text="{Binding Type}" Margin="3" Width="100"/>
                <TextBlock Grid.Column="2" Text="{Binding ContactNumber}" Margin="3" Width="40"/>
            </Grid>
        </DataTemplate>
    </controls:ChildWindow.Resources>
    <Grid x:Name="LayoutRoot" Margin="2">
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <TextBlock Grid.Column="0" Text="カスタムグループ:" Margin="7,13,259.333,284.667"/>
        <TextBox x:Name="CustomGroupNameTextBox" Margin="97,11,64.333,284.667" Width="191"/>
        <Button x:Name="AddCustomGroupButton" Content="+" HorizontalAlignment="Left" Margin="306,11,0,0" 
    		VerticalAlignment="Top" Width="17" Click="AddCustomGroupButton_Click" Height="20"/>

        <Button x:Name="RemoveCustomGroupButton" Content="-" HorizontalAlignment="Left"  Height="20"
    		Margin="327,11,0,0" VerticalAlignment="Top" Width="17" Click="RemoveCustomGroupButton_Click"/>
        <TextBlock Text="ずべてのグループ:" Margin="7,45,1.333,251.667"/>
        <ListBox  x:Name="groupListBox" Margin="8,73,4.333,3.667" ItemsSource="{Binding Groups}" ItemTemplate="{StaticResource GroupInfoTemplate}"  VerticalAlignment="Stretch" SelectionChanged="groupListBox_SelectionChanged" />
        <Button x:Name="CancelButton" Content="閉じる" Click="CancelButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,0,0" Grid.Row="1" />
    </Grid>
</controls:ChildWindow>